package com.fanxing;

/**
 * @Author milian
 * @Date 2021/7/20 0020 10:40
 */
public class fanxing {
    public static void main(String[] args) {
        Cat<String> cat = new Cat<>();
        cat.setT("WQE");
        System.out.println(cat.getT());
        getInde(123);
    }
    public static<T> void getInde(T t){
        System.out.println(t);
    }
}

/**
 * @description: 泛型类
 * @author  milian
 * @date 2021/7/20 0020
 * @version 1.0
 */
class Cat<T>{
    private T t;

    public Cat() {
    }

    public Cat(T t) {
        this.t = t;
    }

    public T getT() {
        return t;
    }

    public void setT(T t) {
        this.t = t;
    }
}
class Dog<T> implements Animal<T>{
    @Override
    public void show(T t) {
        System.out.println("dog");
    }
}

/**
 * @description: 泛型接口
 * @param: interface
 * @return:
 * @author  milian
 * @date: 2021/7/20 0020
 */
interface Animal <T>{
    void show (T t);
}